#include "RSManager.h"
#include "FWContentManager.h"
#include "FWSound.h"
#include "FWSurface.h"
#include "FWTexture.h"
#include "Sprite.h"
#include "ShareComponents.h"
RSManager::RSManager(void)
{
}


RSManager::~RSManager(void)
{
}

void RSManager::Init()
{	
	_go_left = new Sprite(gl_content->loadTexture("Resources\\go_left.png"), 26, 36, 8, 8, 26, 36);
	_go_right = new Sprite(gl_content->loadTexture("Resources\\go_right.png"), 26, 36, 8, 8, 26, 36);
	_jump_left = new Sprite(gl_content->loadTexture("Resources\\jump_left.png"), 26, 38, 1, 1, 26, 38);
	_jump_right = new Sprite(gl_content->loadTexture("Resources\\jump_right.png"), 26, 38, 1, 1, 26, 38);
	_jump_shoot_left = new Sprite(gl_content->loadTexture("Resources\\jump_shoot_left.png"), 26, 38, 1, 1, 26, 38);
	_jump_shoot_right = new Sprite(gl_content->loadTexture("Resources\\jump_shoot_right.png"), 26, 38, 1, 1, 26, 38);
	_shoot_left = new Sprite(gl_content->loadTexture("Resources\\shoot_left.png"), 26, 36, 1, 1, 26, 36);
	_shoot_right = new Sprite(gl_content->loadTexture("Resources\\shoot_right.png"), 26, 36, 1, 1, 26, 36);
	_stand_left = new Sprite(gl_content->loadTexture("Resources\\stand_left.png"), 26, 36, 1, 1, 26, 36);
	_stand_right = new Sprite(gl_content->loadTexture("Resources\\stand_right.png"), 26, 36, 1, 1, 26, 36);
	_sliding_left = new Sprite(gl_content->loadTexture("Resources\\sliding_left.png"), 33, 23, 1, 1, 33, 23);
	_sliding_right = new Sprite(gl_content->loadTexture("Resources\\sliding_right.png"), 33, 23, 1, 1, 33, 23);
	_bullet = new Sprite(gl_content->loadTexture("Resources\\bullet.png"), 15, 15, 1, 1, 15, 15);
	little_fairy = new Sprite(gl_content->loadTexture("Resources\\fairy.png"), 50, 50, 6, 6, 50, 50);
	angel = new Sprite(gl_content->loadTexture("Resources\\angel.png"), 100, 50, 2, 2, 100, 50);
	_backGround = new Sprite(gl_content->loadTexture("Resources\\bg.png"), 1920, 600, 1, 1, 1920, 600);
	_snow = new Sprite(gl_content->loadTexture("Resources\\snow.png"),12,12,1,1,12,12);
	_cloud = new Sprite(gl_content->loadTexture("Resources\\cloud1.png"), 2000, 100, 1, 1, 2000, 100);
	_bear =  new Sprite(gl_content->loadTexture("Resources\\bear.png"),50,60,10,10,50,60);
}

RSManager* RSManager::getInstance()
{
	if(_instance == NULL)
	{
		_instance = new RSManager();
	}
	return _instance;
}


FWSound* RSManager::getSound(SOUND_ID id)
{
	return NULL;
}

Sprite* RSManager::getSprite(SPRITE_ID id)
{
	switch (id)
	{
	case GO_LEFT:		
		return new Sprite( _go_left);		
		break;
	case GO_RIGHT:
		return new Sprite(_go_right);
		break;
	case JUMP_LEFT:
		return new Sprite(_jump_left);
		break;
	case JUMP_RIGHT:
		return new Sprite(_jump_right);
		break;
	case SHOOT_LEFT:
		return new Sprite(_shoot_left);
		break;
	case SHOOT_RIGHT:
		return new Sprite(_shoot_right);
		break;
	case STAND_LEFT:
		return new Sprite(_stand_left);
		break;
	case STAND_RIGHT:
		return new Sprite(_stand_right);
		break;
	case JUMP_SHOOT_LEFT:
		return new Sprite(_jump_shoot_left);
		break;
	case JUMP_SHOOT_RIGHT:
		return new Sprite(_jump_shoot_right);
		break;
	case SLIDING_LEFT:
		return new Sprite(_sliding_left);
		break;
	case SLIDING_RIGHT:
		return new Sprite(_sliding_right);
		break;
	case BULLET:
		return new Sprite(_bullet);
		break;
	case BACKGROUND:
		return new Sprite(_backGround);
		break;
	case LITTLE_FAIRY:
		return new Sprite(little_fairy);
	case ANGEL:
		return new Sprite(angel);
	case SNOW:
		return _snow;
	case CLOUD:
		return new Sprite(_cloud);
break;
case BEAR:
		return new Sprite(_bear);
		break;
	default:
		break;
	}	
}